﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Left.aspx.cs" Inherits="RichECMS.ServerPages.Left" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../sysCommon/sysStyle/style.css" type="text/css" rel="stylesheet" />
    <script src="../sysCommon/sysScripts/jquery/1.4.2/Jquery.js" type="text/javascript"></script>
    <script src="../sysCommon/sysScripts/drill-down-menu/js/jquery.cookie.js" type="text/javascript"></script>
    <script src="../sysCommon/sysScripts/drill-down-menu/js/jquery.dcdrilldown.1.2.js"
        type="text/javascript"></script>
    <link href="../sysCommon/sysScripts/drill-down-menu/css/dcdrilldown.css" rel="stylesheet"
        type="text/css" />
    <link href="../sysCommon/sysScripts/drill-down-menu/css/skins/blue.css" rel="stylesheet"
        type="text/css" />
    <link href="../sysCommon/sysScripts/drill-down-menu/css/skins/my.css" rel="stylesheet"
        type="text/css" />
    <link href="../sysCommon/sysScripts/drill-down-menu/css/skins/demo.css" rel="stylesheet"
        type="text/css" />
    <link href="../sysCommon/sysScripts/drill-down-menu/css/skins/graphite.css" rel="stylesheet"
        type="text/css" />
    <link href="../sysCommon/sysScripts/drill-down-menu/css/skins/grey.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">
        function createchildsmenu(pid) {
            var mainclasslistli = $("#barsource li[pid='" + pid + "']");
            if (mainclasslistli.size() > 0) {
                for (var i = 0; i < mainclasslistli.size(); i++) {
                    var htmltmp = "<li id='li" + mainclasslistli.eq(i).attr("sid") + "' >" + mainclasslistli.eq(i).html() + "</li>";
                    $("#ul" + pid).append(htmltmp);

                    if ($("#barsource li[pid='" + mainclasslistli.eq(i).attr("sid") + "']").size() > 0) {

                        if ($("#ul" + mainclasslistli.eq(i).attr("sid")).size() == 0) {
                            $("#li" + mainclasslistli.eq(i).attr("sid")).append("<ul id='ul" + mainclasslistli.eq(i).attr("sid") + "'   title='这个的PID是" + pid + "'></ul>");
                        }
                        createchildsmenu(mainclasslistli.eq(i).attr("sid"));
                    }
                }
            }
        }

        $(document).ready(function () {
            //$('#drilldown-1').dcDrilldown(); ;
            //var mainul = ""
            if ($("#hiddenpid").val() != '') {
                var pidmain = $("#hiddenpid").val();
                $("#sectiolistbar").append("<ul id='ul" + pidmain + "'></ul>")
                //alert(".left_main li[pid='" + pidmain + "']   ||   " + $(".left_main li[pid='" + pidmain + "']").size());
                var mainclasslistli = $("#barsource li[pid='" + pidmain + "']");
                if (mainclasslistli.size() > 0) {
                    createchildsmenu(pidmain);
                }
                $('#ul' + pidmain).dcDrilldown({
                    speed: 'slow',
                    resetText: '根目录',
                    defaultText: '选择栏目',
                    saveState: false,
                    showCount: false,
                    linkType: 'breadcrumb'
                });
            }
            $(".left_main li[id*='li'] a").click(function () {
                var href = $(this).attr("href");
                window.parent.changeframelink(href);
                return false;

                //                if ($(".left_main a").index(this) != 0) {
                //                    var href = $(this).attr("href");
                //                    window.parent.changeframelink(href);
                //                    return false;
                //                } else {
                //                    return false;
                //                }
            });

            $(".iframeright").click(function () {
                var href = $(this).attr("href");
                window.parent.changeframelink(href);
                return false;
            });


            $(".menulist").not(":first").hide();
            $(".menumain").click(function () {
                var index = $(".menumain").index(this);
                var menulistdom = $(".menulist").eq(index);
                menulistdom.slideDown();
                $(".menulist").not(menulistdom).slideUp();
            });

            //            var sctionname = $(".left_main a").eq(0).html();
            //            var scname = "";
            //            if (deleteString(sctionname, "内容列表") != null) {
            //                scname = deleteString(sctionname, "内容列表").replace(/(^\s*)|(\s*$)/g, "");
            //            }
            //            if (deleteString(sctionname, "栏目") != null) {
            //                scname = deleteString(sctionname, "栏目").replace(/(^\s*)|(\s*$)/g, "");
            //            }

            //$(".left_main a").eq(0).html("<font style='color:#F9DACA'>当前主版块</font> <font style='color:#EEB111'>" + scname + '</font>');
        });

        //提取查找字符串前面所有的字符
        function getFront(mainStr, searchStr) {
            foundOffset = mainStr.indexOf(searchStr);
            if (foundOffset == -1) {
                return null;
            }
            return mainStr.substring(0, foundOffset);
        }
        //提取查找字符串后面的所有字符
        function getEnd(mainStr, searchStr) {
            foundOffset = mainStr.indexOf(searchStr);
            if (foundOffset == -1) {
                return null;
            }
            return mainStr.substring(foundOffset + searchStr.length, mainStr.length);
        }
        //在字符串 searchStr 前面插入字符串 insertStr
        function insertString(mainStr, searchStr, insertStr) {
            var front = getFront(mainStr, searchStr);
            var end = getEnd(mainStr, searchStr);
            if (front != null && end != null) {
                return front + insertStr + searchStr + end;
            }
            return null;
        }
        //删除字符串 deleteStr
        function deleteString(mainStr, deleteStr) {
            return replaceString(mainStr, deleteStr, "");
        }
        //将字符串 searchStr 修改为 replaceStr
        function replaceString(mainStr, searchStr, replaceStr) {
            var front = getFront(mainStr, searchStr);
            var end = getEnd(mainStr, searchStr);
            if (front != null && end != null) {
                return front + replaceStr + end;
            }
            return null;
        }

        //获取url中"?"符后的字串
        function GetRequest() {
            var url = location.search; //获取url中"?"符后的字串
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for (var i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }
    </script>
    <script src="../sysCommon/sysScripts/parent1.js" type="text/javascript"></script>
    <script src="../sysCommon/sysScripts/commompage.js" type="text/javascript"></script>
    <style type="text/css">
        .menumain
        {
            cursor: pointer;
        }
        .menuScPar
        {
            margin:2px 2px 2px 2px;
            padding:0px 0px 0px 0px;
            max-height: 396px;
            min-height: 0px;
            _height: expression(this.scrollHeight > 396 ? "396px" : (this.scrollHeight <= 0 ? "0px" : "auto"));
            overflow-x:hidden;
            overflow-y:auto;
        }
        #sectiolistbar
        {
            margin:0 auto;
            width: 192px;;
            }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="main_body">
        <div class="left_body">
            <div class="left_title menumain">
                栏目文章操作
            </div>
            <ul id="barsource" style="display: none;">
                <asp:Repeater ID="rptList" runat="server">
                    <ItemTemplate>
                        <li pid='<%#Eval("intParentID").ToString()%>' sid='<%#Eval("intSectionID").ToString()%>'>
                            <a class="leftLink" href='<%#Eval("intType").ToString()=="2"?"Section/Update.aspx?Section=" +Eval("intSectionID").ToString():"Section/List.aspx?Section=" +Eval("intSectionID").ToString()%>'>
                                <%# Eval("chvSTCName").ToString()   %></a> </li>
                    </ItemTemplate>
                </asp:Repeater>
            </ul>
            <div class="left_main menulist menuScPar">
                <div class="grey demo-container" id="sectiolistbar">
                </div>
            </div>
            <div class="left_bottom menumain">
                通用功能
            </div>
            <div class="left_main menulist">
                <ul>
                    <li runat="server" id="AAccountManager" visible="false"><a href='User/UserManage.aspx'
                        title='账户管理' class='iframeright'>账户管理</a></li>
                    <li runat="server" id="AmanagerClients" visible="false"><a class="iframeright" href="Clients/list.aspx"
                        title="注册管理">注册管理</a></li>
                    <li><a class="iframeright" href="###" title="查看网站" runat="server" id="ALookWeb">查看网站</a></li>
                    <li><a class="iframeright" href="###" title="待审核的文章">待审核的文章</a></li>
                    <li><a class="iframeright" href="Comment/list.aspx" title="评论管理">评论管理</a></li>
                    <li><a class="iframeright" href="Section/RecycleList.aspx" title="内容回收站">内容回收站</a></li>
                    <li runat="server" id="ASectionSet" visible="false"><a class="iframeright" href="Section/IframeSectionMain.aspx"
                        title="内容回收站">网站栏目管理</a></li>
                    <li runat="server" id="APageEditor" visible="false"><a class="iframeright" href="CoderEditor/EditorIndex.aspx"
                        title="内容回收站">代码编辑器</a></li>
                    <li runat="server" id="ATemplateSet" visible="false"><a class="iframeright" href="Template/TemplateManage.aspx"
                        title="内容回收站">网站模版管理</a></li>
                    <li runat="server" id="AWebSetting" visible="false"><a class="iframeright" href="SysManage/WebSetting.aspx"
                        title="内容回收站">网站全局设置</a></li>
                    <li ><a class="iframeright" href="SysManage/Helper.aspx"
                        title="网站帮助">网站帮助</a></li>
                </ul>
            </div>
            <div class="left_bottom menumain">
                版权声明
            </div>
            <div class="left_main menulist">
                <span style="color: #fff;">该版本最终解释权归锐之旗所有</span>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="hiddenpid" runat="server" />
    </form>
</body>
</html>
